import java.util.Scanner;

public class Main1466 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int m= sc.nextInt();
        int n= sc.nextInt();
            for (int i=m;i<=n;i++){
                int a=i/1000;//1
                int b=i/100%10;//2
                int c=i%100/10;//3
                int d=i%10;//4
                if (a==0&&b-c==c-d){
                    System.out.println(i);
                }else if (a!=0&&a-b==b-c&&b-c==c-d){
                    System.out.println(i);
                }
            }
        }
    }

